#include <iostream>
#include "InterfaceTypeA.h"
using namespace std;

int main()
{
    const char *clazz_name = "ClassA";
    const char *clazz_b_name = "my_namespace::ClassB";

    const rtti::Clazz *clazz = rtti::Clazz::for_name(clazz_b_name);
    if (NULL == clazz)
    {
        cout << "class "<< clazz_b_name <<" not exist" << endl;
        return -1;
    }

    rtti::Object *obj = clazz->new_instance();

    if (obj->instance_of(RTTI_TYPE_CLAZZ(rtti::Object)))
    {
        cout << "class " << obj->get_class().get_name() << " inherit from rtti::Object" << endl;
    }

    if (obj->instance_of(RTTI_TYPE_CLAZZ(InterfaceTypeA)))
    {
        cout << "class " << obj->get_class().get_name() << " inherit from InterfaceTypeA" << endl;
        InterfaceTypeA *interface_type_a = (InterfaceTypeA*) obj;
        interface_type_a->myname();
    }
    delete obj;

    return 0;
}

